/*    */ package com.newcrm.webapi.sub;
/*    */ 
/*    */ import com.newcrm.db.CustomerManager;
/*    */ import com.newcrm.exception.DBException;
/*    */ import com.newcrm.exception.NotFoundException;
/*    */ import com.newcrm.util.Util;
/*    */ import com.newcrm.webapi.AbstractAction;
/*    */ import com.newcrm.webapi.AbstractHttpServlet;
/*    */ import java.io.IOException;
/*    */ import java.io.PrintWriter;
/*    */ import java.sql.SQLException;
/*    */ import java.util.List;
/*    */ import javax.servlet.ServletException;
/*    */ import javax.servlet.http.HttpServletRequest;
/*    */ import javax.servlet.http.HttpServletResponse;
/*    */ import net.sf.json.JSONObject;
/*    */ import org.apache.log4j.Logger;
/*    */ 
/*    */ public class ListCustomerExtInfo extends AbstractAction
/*    */ {
/* 26 */   private static Logger logger = Logger.getLogger(ListCustomerExtInfo.class
/* 27 */     .getName());
/*    */ 
/*    */   public ListCustomerExtInfo(AbstractHttpServlet servlet)
/*    */   {
/* 30 */     super(servlet);
/*    */   }
/*    */ 
/*    */   public void parse(HttpServletRequest request, HttpServletResponse response)
/*    */     throws IOException, ServletException, NotFoundException
/*    */   {
/* 36 */     response.setContentType("text/html;charset=utf-8");
/* 37 */     PrintWriter out = response.getWriter();
/* 38 */     String customerIds = Util.getURLParameter(request
/* 39 */       .getParameter("customerIds"));
/* 40 */     String typeIds = Util.getURLParameter(request.getParameter("typeIds"));
/* 41 */     CustomerManager manager = new CustomerManager();
/* 42 */     JSONObject jsonObject = new JSONObject();
/*    */     try {
/* 44 */       List result = manager.getCustomerExtInfo(
/* 45 */         customerIds, typeIds);
/* 46 */       if (result == null) {
/* 47 */         jsonObject.put("error", "1");
/*    */       } else {
/* 49 */         jsonObject.put("error", "0");
/* 50 */         jsonObject.put("customerExtInfo", result);
/*    */       }
/*    */     } catch (DBException e) {
/* 53 */       logger.warn("DBException", e);
/* 54 */       jsonObject.put("error", "1");
/*    */     } catch (SQLException e) {
/* 56 */       logger.warn("SQLException", e);
/* 57 */       jsonObject.put("error", "1");
/*    */     }
/* 59 */     out.println(jsonObject);
/* 60 */     out.flush();
/* 61 */     out.close();
/*    */   }
/*    */ }

/* Location:           C:\E\referenceProject\CRM参考\qikebao\WEB-INF\lib\qikebao.jar
 * Qualified Name:     com.newcrm.webapi.sub.ListCustomerExtInfo
 * JD-Core Version:    0.6.1
 */